Telegram Group & Telegram Channel
19. Program to Find Harmonic Series.

import java.util.*;

class HarmonicSeries
{

public static void main(String args[])
{

int num, i = 1;
double rst = 0.0;

Scanner in = new Scanner(System.in);
System.out.println("Enter the number for length of series");
num = in.nextInt();

while (i <= num)
{

System.out.print("1/" + i + " +");
rst = rst + (double) 1 / i;

i++;
}

System.out.println("\n\nSum of Harmonic Series is " + rst);
}
}

@java_Codings



tg-me.com/java_codings/28
Create:
Last Update:

19. Program to Find Harmonic Series.

import java.util.*;

class HarmonicSeries
{

public static void main(String args[])
{

int num, i = 1;
double rst = 0.0;

Scanner in = new Scanner(System.in);
System.out.println("Enter the number for length of series");
num = in.nextInt();

while (i <= num)
{

System.out.print("1/" + i + " +");
rst = rst + (double) 1 / i;

i++;
}

System.out.println("\n\nSum of Harmonic Series is " + rst);
}
}

@java_Codings

BY Advance Java πŸ‘¨β€πŸ’»


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/java_codings/28

View MORE
Open in Telegram


Advance Java ‍ Telegram | DID YOU KNOW?

Date: |

NEWS: Telegram supports Facetime video calls NOW!

Secure video calling is in high demand. As an alternative to Zoom, many people are using end-to-end encrypted apps such as WhatsApp, FaceTime or Signal to speak to friends and family face-to-face since coronavirus lockdowns started to take place across the world. There’s another optionβ€”secure communications app Telegram just added video calling to its feature set, available on both iOS and Android. The new feature is also super secureβ€”like Signal and WhatsApp and unlike Zoom (yet), video calls will be end-to-end encrypted.

Telegram today rolling out an update which brings with it several new features.The update also adds interactive emoji. When you send one of the select animated emoji in chat, you can now tap on it to initiate a full screen animation. The update also adds interactive emoji. When you send one of the select animated emoji in chat, you can now tap on it to initiate a full screen animation. This is then visible to you or anyone else who's also present in chat at the moment. The animations are also accompanied by vibrations. This is then visible to you or anyone else who's also present in chat at the moment. The animations are also accompanied by vibrations.

Advance Java ‍ from tr


Telegram Advance Java πŸ‘¨β€πŸ’»
FROM USA